﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LdtJudge.DataEngine.Model.ElmentModel
{
    /// <summary>
    /// 要素模型处理
    /// </summary>
    [Serializable]
    public class NodeModel : ICloneable
    {
        /// <summary>
        /// 节点名称
        /// </summary>
        public string NodeName { get; set; }
        /// <summary>
        /// 节点路径
        /// </summary>
        public string NodePath { get; set; }
        /// <summary>
        /// 要素本身ID
        /// </summary>
        public string NodeID { get; set; }
        /// <summary>
        /// 本节点生成的关系ID
        /// </summary>
        public string GuidID { get; set; }
        /// <summary>
        /// 上级ID
        /// </summary>
        public string ParentGuidID { get; set; }
        /// <summary>
        /// 节点原文的GUID
        /// </summary>
        public string OriginalGuidID { get; set; }
        /// <summary>
        /// 提取值是否为空 默认为false 如果有值则为true
        /// </summary>
        public bool IsNullExtOriginalText { get; set; }
        /// <summary>
        /// 如果是证据类型，则该属性用来确定是否认定
        /// 1 认定 0 待认定
        /// </summary>
        public string IsConfirm { get; set; }
        /// <summary>
        /// 节点类型 1:节点、2:属性
        /// </summary>
        public int ModelType { get; set; }
        /// <summary>
        /// 转换类型
        /// </summary>
        public string SourcType { get; set; }
        /// <summary>
        /// 待提取原文
        /// </summary>
        public string OriginalText { get; set; }
        /// <summary>
        /// 提取后的原文
        /// </summary>
        public IList<string> ExtOriginalText { get; set; }

        /// <summary>
        /// 提取结果
        /// </summary>
        public IList<string> ExtValue { get; set; }
        /// <summary>
        /// 执行当前节点的条件
        /// </summary>
        public CommElementRegexCode ElementCommWhere { get; set; }

        /// <summary>
        /// 加载配置的Configxml
        /// </summary>
        public ElementConfigModel ElementConfigModel { get; set; }

        /// <summary>
        /// 原文定位
        /// </summary>
        public string OriginalLocation { get; set; }

        /// <summary>
        /// 原文定位长度
        /// </summary>
        public string OriginalLocationLen { get; set; }

        /// <summary>
        /// 复制对象
        /// </summary>
        /// <returns></returns>
        public object Clone()
        {
            NodeModel nodeModel = new NodeModel();
            nodeModel.ElementCommWhere = ElementCommWhere;
            nodeModel.ElementConfigModel = ElementConfigModel;
            nodeModel.ExtOriginalText = ExtOriginalText;
            nodeModel.GuidID = GuidID;
            nodeModel.IsConfirm = IsConfirm;
            nodeModel.IsNullExtOriginalText = IsNullExtOriginalText;
            nodeModel.ModelType = ModelType;
            nodeModel.NodeID = NodeID;
            nodeModel.NodeName = NodeName;
            nodeModel.NodePath = NodePath;
            nodeModel.OriginalText = OriginalText;
            nodeModel.ParentGuidID = ParentGuidID;
            nodeModel.SourcType = SourcType;
            nodeModel.ExtValue = ExtValue;
            nodeModel.OriginalLocation = OriginalLocation;
            nodeModel.OriginalLocationLen = OriginalLocationLen;
            return nodeModel;


        }
    }
}
